#!/usr/bin/env python
#coding=utf-8

# 列表
aList = [123,"123","dsafd",[123,"23"]]
del aList[1]
print aList
aList.remove(123)
print aList

# 列表 可以适用 in / not in / +

# 列表的比较
# 在列表的比较中数字是最小的
# 以类型名字的字母顺序进行比较
print 2 > "1" # false
# 以字典序列排列
s = ['they', 'stamp', 'them', 'when', "they're", 'small']
print sorted(s) # ['small', 'stamp', 'them', 'they', "they're", 'when']
print s.sort(),s
# 逆向排列
for t in reversed(s):
	print t, # small they're when them stamp they
print
print s.reverse(), s
fn = ['ian', 'stuart', 'david']
ln = ['bairnson', 'elliott', 'paton']
for i,j in zip(fn, ln):
	print ('%s %s' % (i,j)).title()# 字符串标题化

print reduce(lambda x, y: x+y, [1,2,3,4,5])  # 使用 lambda 匿名函数  第一个参数是一个函数  接收两个参数
print sum([1,2,3,4,5])
# list he tuple 之间的相互转换
aList=['tao', 93, 96, 'time']
aTuple = tuple(aList)
print aList,aTuple
print list(aTuple)



